package com.mdr.imedera.controller.test;

import com.mdr.imedera.util.RedisUtil;
import com.mdr.imedera.util.wx.AccessToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author wxb
 * @Datatime 2020/10/21 17:47
 * @Descript 测试Redis 进行数据保存
 */
@RestController
@RequestMapping("redis")
public class RedisController {

    @Resource private RedisUtil redisUtil;

    @Autowired private AccessToken accessToken;

    @GetMapping("save")
    private String save(){
        String accessToken = this.accessToken.getAccessToken();
        System.out.println("accessToken:"+accessToken);
        redisUtil.set("access_token",accessToken);
        return accessToken;
    }

}
